package com.seadragon.app.ksr.controller;

import static com.seadragon.app.ksr.model.KsrConstants.gf;

import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.seadragon.app.ksr.model.Address;
import com.seadragon.app.ksr.model.Business;
import com.seadragon.app.ksr.model.Category;
import com.seadragon.app.ksr.model.Customer;
import com.seadragon.app.ksr.model.Office;
import com.seadragon.app.ksr.model.Review;
import com.vividsolutions.jts.geom.Coordinate;

public class DummyData {
	public static Address getDummyAddress(){
		Address addr = new Address();
		addr.setAddressLine1("12661 Magna Carta Rd.");
		addr.setCity("Herndon");
		addr.setState("VA");
		addr.setZip("20171");
		return addr;
	}
	
	public static Office getDummyOffice(){
		Office office = new Office();
		office.setAddress(getAddress("12661 Magna Carta Rd.","Herndon" , "VA", "20171",38.93527,-77.38496));
		office.setEmailAddress("yadong.zhu@gmail.com");
		office.setPhoneNumber("571-572-9527");
		office.setSpecialty("drawing, painting, pottery, ceramics, digital arts, camps");
		office.setReviewCount(getReviewList().size());
		office.setRating(80);
		office.setDescription("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.");
		office.setBusiness(getDummyBusiness());
		return office;
	}
	
	public static Business getDummyBusiness(){
		Business business = new Business();
		business.setBusinessName("Renaissance Art Center LLC");
		business.setBusinessType("Education");
		Set<Category> categories = new HashSet<Category>();
		Category categ = new Category();
		categ.setName("Drawing");
		categories.add(categ);
		
		categ = new Category();
		categ.setName("Painting");
		categories.add(categ);
		
		categ = new Category();
		categ.setName("Piano");
		categories.add(categ);
		
		business.setCategories(categories);
		business.setDescription("Renaissance Arts offers a variety of structured, progressive, term-based courses for students of all ages as well as specialized Camps and intensive Workshops throughout the year. Each of our class curriculums are carefully crafted to provide continual challenge and variety to keep the projects interesting and allow the opportunity to introduce new skills and techniques, while always emphasizing fun and accomplishment as students progress.");
		business.setEmailAddress("info@rcarts.com");
		business.setPhoneNumber("1-866-212-6604");
		business.setSpecialty("drawing, painting, pottery, ceramics, digital arts, camps");
		business.setWebSite("http://www.rcarts.com");
		List<Office> offices = new ArrayList<Office>();
//		business.setOffices(offices);
		Address address = new Address();
		address.setAddressLine1("9250 Gaither Road");
		address.setCity("Gaithersburg");
		address.setState("MD");
		address.setZip("20877");
		Office office = new Office();
//		offices.add(getDummyOffice());
		office.setAddress(address);
		office.setBusiness(business);
		office.setEmailAddress("info@rcarts.com");
		office.setPhoneNumber("1-866-212-6604");
		office.setSpecialty("drawing, painting, pottery, ceramics, digital arts, camps");
		return business;
	}
	
	public static Office getOffice(Long id,Address add,String email,String phone,String specialty,int rating){
		Office office = new Office();
		office.setId(id);
		office.setAddress(add);
		office.setEmailAddress(email);
		office.setPhoneNumber(phone);
		office.setSpecialty(specialty);
		office.setRating(rating);
		Business business = getDummyBusiness();
//		business.setOffices(null);
		office.setBusiness(business);
		office.setReviewCount(getReviewList().size());
		office.setDescription("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.");
		return office;	
	}
	public static Review getDummyReview(int rating){
		Review review = new Review();
		review.setRating(rating);
		review.setContent("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.");
		return review;	
	}
	
	public static Address getAddress(String add,String city,String state,String zip,double lat,double lon){
		Address addr = new Address();
		addr.setAddressLine1(add);
		addr.setCity(city);
		addr.setState(state);
		addr.setZip(zip);
		addr.setLocation(gf.createPoint(new Coordinate(lon, lat)));
		return addr;
	}	
	
	public static Customer getCustomer(){
		Customer ct = new Customer();
		ct.setId(1l);
		ct.setDateOfBirth(new GregorianCalendar(2005,1,2).getTime());
		ct.setEmail("yadong.zhu@gmail.com");
		ct.setFirstName("Yadong");
		ct.setLastName("Zhu");
		ct.setPhoneNumber("571-572-9527");
		ct.setInterest("piano,drawing,computer");
		ct.setAddress(getAddress("283 Sunset Park Dr", "Herndon", "VA", "20170",38.95662,-77.37469));
		return ct;
	}	
	
	public static Review getReivew(String content,int rating){
		Review rv = new Review();
		rv.setContent(content);
		rv.setRating(rating);
		rv.setDateCreated(new GregorianCalendar(2005,1,2).getTime());
		rv.setDateUpdated(new GregorianCalendar(2005,5,2).getTime());
		rv.setCustomer(getCustomer());
		//rv.setOffice(getOffice(1l,getAddress("283 Sunset Park Dr", "Herndon", "VA", "20170",38.95662,-77.37469), "abc@def.com", "(703) 471-2017", "drawing"));
		return rv;
	}	
	
	public static List<Office> getOfficeList(){
		List<Office> list = new ArrayList<Office>();
		list.add(getOffice(1l,getAddress("283 Sunset Park Dr", "Herndon", "VA", "20170",38.95662,-77.37469), "abc@def.com", "(703) 471-2017", "drawing",1));
		list.add(getOffice(2l,getAddress("2465 J-1 Centreville Rd", "Herndon", "VA", "20170",38.95044,-77.41064), "def@def.com", "(703) 713-0103", "painting",2));
		list.add(getOffice(3l,getAddress("1106 Herndon Pkwy", "Herndon", "VA", "20170",38.97699,-77.37156), "ggg@def.com", "(703) 713-0103", "pottery",3));
		list.add(getOffice(4l,getAddress("13021 Worldgate Dr", "Herndon", "VA", "20170",38.95726,-77.40106), "fff@def.com", "(703) 471-2000", "ceramics",4));
		list.add(getOffice(5l,getAddress("171 Elden St", "Herndon", "VA", "20170",38.96524,-77.36771), "fff@def.com", "(703) 471-2000", "ceramics",5));
		list.add(getOffice(6l,getAddress("410 Elden St", "Herndon", "VA", "20170",38.97009,-77.37423), "fff@def.com", "(703) 471-2000", "ceramics",2));
		list.add(getOffice(7l,getAddress("13320 Franklin Farm Rd", "Herndon", "VA", "20170",38.90739,-77.40788), "ccc@def.com", "(703) 787-8812", "digital arts",3));
		list.add(getOffice(8l,getAddress("201 Elden St", "Herndon", "VA", "20170",38.96595,-77.36973), "ccc@def.com", "(703) 787-8812", "digital arts",4));
		list.add(getOffice(9l,getAddress("11964 Market St", "Reston", "VA", "20190",38.95836,-77.36016), "ccc@def.com", "(703) 787-8812", "digital arts",4));
		list.add(getOffice(10l,getAddress("135 Spring St", "Herndon", "VA", "20170",38.95730,-77.37347), "ccc@def.com", "(703) 787-8812", "digital arts",3));
		list.add(getOffice(11l,getAddress("11790-A Baron Cameron Ave", "Reston", "VA", "20190",38.96762,-77.35530), "ccc@def.com", "(703) 787-8812", "digital arts",2));
		list.add(getOffice(12l,getAddress("11915 Democracy Dr", "Reston", "VA", "20190",38.95788,-77.35800), "ccc@def.com", "(703) 787-8812", "digital arts",5));
		return list;
	}
	
	public static List<Review> getReviewList(){
		List<Review> list = new ArrayList<Review>();
		list.add(getReivew("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.. ", 1));
		list.add(getReivew("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. ", 1));
		list.add(getReivew("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.. ", 2));
		list.add(getReivew("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", 3));
		list.add(getReivew("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.. ", 3));
		list.add(getReivew("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", 4));
		list.add(getReivew("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.. ", 4));
		list.add(getReivew("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.", 5));
		list.add(getReivew("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.. ", 5));
		list.add(getReivew("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.. ", 5));
		return list;
	}
	
	public static Address getCenterLocation(){
		Address add = getAddress("12661 Magna Carta Rd.","Herndon" , "VA", "20171",38.93527,-77.38496);
//		add.setLat(38.935272);
//		add.setLon(-77.384959);
		return add;
	}
}
